package com.ssy.system.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author ssy
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_user")
public class User implements Serializable {
    private static final long serialVersionUID = -377323374576977394L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String realName;

    private String password;

    private String salt;

    private String userName;

    private Integer depId;

    private String phone;

    private Integer sex;

    private Integer age;

    private Integer level;

    private String education;

    private Integer state;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    private Integer type;

    @TableField(exist = false)
    private String levelName;

    @TableField(exist = false)
    private String userTypeName;

    @TableField(exist = false)
    private String depName;

    @TableField(exist = false)
    private String code;

    public User(Integer id, String password, String salt) {
        this.id = id;
        this.password = password;
        this.salt = salt;
    }
}
